<template>
  <div>
    <van-card v-for="p in products" :key="p.id"
  num="2"
  :price="p.price"
  :desc="p.desc"
  :title="p.title"
  :thumb="p.picture"

  @click="goTo(p.id)"
>
  
  <template #footer>
    <van-button size="mini">按钮</van-button>
    <van-button size="mini">按钮</van-button>
  </template>
</van-card>
 
  </div>
</template>
<script>
export default {
  data(){
    return {
      
    }
  },
  computed:{
    products(){
      return this.$store.state.products
    }
  },
  methods:{
    goTo(id){
      this.$router.push('/detail/'+id);
    }
  }
}
</script>